package br.com.firula.to;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="bolao")
@SequenceGenerator(name="SEQUENCE", sequenceName="bolao_seq")
@Inheritance(strategy=InheritanceType.JOINED)
public class BolaoTO extends BaseTO{

	private static final long serialVersionUID = -6745652014593124522L;

	@Id
	@Column(name="id", nullable=false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;

	@Column(name="descricao", nullable=false)
	private String descricao;

	@Column(name="premio", nullable=false)
	private String premio;

	@ManyToMany(fetch = FetchType.LAZY, mappedBy="bolaoApostas", targetEntity=UsuarioTO.class)
	private List<UsuarioTO> usuariosAposta;

	@ManyToMany(fetch = FetchType.LAZY, mappedBy="bolaoVencedores", targetEntity=UsuarioTO.class)
	private List<UsuarioTO> usuariosVencedores;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getPremio() {
		return premio;
	}

	public void setPremio(String premio) {
		this.premio = premio;
	}

	public List<UsuarioTO> getUsuariosAposta() {
		return usuariosAposta;
	}

	public void setUsuariosAposta(List<UsuarioTO> usuariosAposta) {
		this.usuariosAposta = usuariosAposta;
	}

	public List<UsuarioTO> getUsuariosVencedores() {
		return usuariosVencedores;
	}

	public void setUsuariosVencedores(List<UsuarioTO> usuariosVencedores) {
		this.usuariosVencedores = usuariosVencedores;
	}

	@Override
	public String getAbreviation() {
		// TODO Auto-generated method stub
		return null;
	}

}
